Source for file TinyPspellShell.class.php
Documentation is available at TinyPspellShell.class.php
* Tiny Spelling Interface for TinyMCE Spell Checking.
* Copyright © 2006 Moxiecode Systems AB
function TinyPspellShell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
$this->tmpfile =
tempnam($config['tinypspellshell.tmp'], "tinyspell");
$this->cmd =
$config['tinypspellshell.aspell'] .
" -a --lang=".
$this->lang.
" --encoding=utf-8 -H < $this->tmpfile 2>&1";
$this->cmd =
"cat ".
$this->tmpfile .
" | " .
$config['tinypspellshell.aspell'] .
" -a --encoding=utf-8 -H --lang=".
$this->lang;
// Returns array with bad words or false if failed.
foreach($wordArray as $key =>
$value)
fwrite($fh, "^" .
$value .
"\n");
$this->errorMsg[] =
"PSpell not found.";
$dataArr =
preg_split("/\n/", $data, -
1, PREG_SPLIT_NO_EMPTY);
foreach($dataArr as $dstr) {
preg_match("/\& (.*) .* .*: .*/i", $dstr, $matches);
$returnData[] =
$matches[1];
// Returns array with suggestions or false if failed.
$word =
mb_convert_encoding($word, "ISO-8859-1", mb_detect_encoding($word, "UTF-8"));
die("Error opening tmp file.");
$dataArr =
preg_split("/\n/", $data, -
1, PREG_SPLIT_NO_EMPTY);
foreach($dataArr as $dstr) {
preg_match("/\& .* .* .*: (.*)/i", $dstr, $matches);
if (!empty($matches[1])) {
// For some reason, the exec version seems to add commas?
$fh =
@fopen("debug.log", 'a+');
// Setup classname, should be the same as the name of the spellchecker class
$spellCheckerConfig['class'] =
"TinyPspellShell";
Documentation generated on Mon, 05 May 2008 16:23:18 +0400 by phpDocumentor 1.4.0